package com.ruoyi.customerSample.service.impl;


import com.ruoyi.customerSample.domain.SampleTypeDetails;
import com.ruoyi.customerSample.mapper.SampleTypeDetailsMapper;
import com.ruoyi.customerSample.service.ISampleTypeDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 样品分类保存明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-05-15
 */
@Service
public class SampleTypeDetailsServiceImpl implements ISampleTypeDetailsService
{
    @Autowired(required = false)
    private SampleTypeDetailsMapper sampleTypeDetailsMapper;

    /**
     * 查询样品分类保存明细
     * 
     * @param id 样品分类保存明细ID
     * @return 样品分类保存明细
     */
    @Override
    public SampleTypeDetails selectSampleTypeDetailsById(String id)
    {
        return sampleTypeDetailsMapper.selectSampleTypeDetailsById(id);
    }

    /**
     * 根据类别id查询明细
     * @param sampleTypeId
     * @return
     */
    @Override
    public List<SampleTypeDetails> selectSampleTypeDetailsByTypeId(String sampleTypeId) {
        return sampleTypeDetailsMapper.selectSampleTypeDetailsByTypeId(sampleTypeId);
    }

    /**
     * 查询样品分类保存明细列表
     * 
     * @param sampleTypeDetails 样品分类保存明细
     * @return 样品分类保存明细
     */
    @Override
    public List<SampleTypeDetails> selectSampleTypeDetailsList(SampleTypeDetails sampleTypeDetails)
    {
        return sampleTypeDetailsMapper.selectSampleTypeDetailsList(sampleTypeDetails);
    }

    /**
     * 新增样品分类保存明细
     * 
     * @param sampleTypeDetails 样品分类保存明细
     * @return 结果
     */
    @Override
    public int insertSampleTypeDetails(SampleTypeDetails sampleTypeDetails)
    {
        return sampleTypeDetailsMapper.insertSampleTypeDetails(sampleTypeDetails);
    }

    /**
     * 批量新增明细
     * @param sampleTypeDetailsList
     * @return
     */
    @Override
    public int batchSampleTypeDetailBill(List<SampleTypeDetails> sampleTypeDetailsList) {
        return sampleTypeDetailsMapper.batchSampleTypeDetailBill(sampleTypeDetailsList);
    }

    /**
     * 修改样品分类保存明细
     * 
     * @param sampleTypeDetails 样品分类保存明细
     * @return 结果
     */
    @Override
    public int updateSampleTypeDetails(SampleTypeDetails sampleTypeDetails)
    {
        return sampleTypeDetailsMapper.updateSampleTypeDetails(sampleTypeDetails);
    }

    /**
     * 批量删除样品分类保存明细
     * 
     * @param ids 需要删除的样品分类保存明细ID
     * @return 结果
     */
    @Override
    public int deleteSampleTypeDetailsByIds(String[] ids)
    {
        return sampleTypeDetailsMapper.deleteSampleTypeDetailsByIds(ids);
    }


    /**
     * 根据类型Id删除
     * @param sampleTypeId
     * @return
     */
    @Override
    public int deleteSampleTypeDetailsByTypeId(String sampleTypeId) {
        return sampleTypeDetailsMapper.deleteSampleTypeDetailsByTypeId(sampleTypeId);
    }

    /**
     * 删除样品分类保存明细信息
     * 
     * @param id 样品分类保存明细ID
     * @return 结果
     */
    @Override
    public int deleteSampleTypeDetailsById(String id)
    {
        return sampleTypeDetailsMapper.deleteSampleTypeDetailsById(id);
    }
}
